﻿@model JuCheap.Core.Models.ViewModels.TimePeriodViewModel

@{
    ViewData["Title"] = "添加时间段";
    Layout = "~/Views/Shared/_Layout_Content.cshtml";
}


<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>添加时间段</h5>
            <div class="ibox-tools">
                <a class="collapse-link">
                    <i class="fa fa-chevron-up"></i>
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <form id="form1" asp-controller="TimePeriod" asp-action="Add" class="form-horizontal" method="POST">
                <div class="form-group">
                    <label class="col-sm-3 control-label" asp-for="PeriodName"></label>
                    <div class="col-sm-8">
                        <input asp-for="PeriodName" class="form-control" placeholder="时间段名称" />
                        <span asp-validation-for="PeriodName"></span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">时间段</label>
                    <div class="col-sm-8">

                        <select name="TimeStart" id="TimeStart"
                                class="form-control" placeholder="开始">
                            <option value="0" selected="selected">00</option>
                            <option value="1">01</option>
                            <option value="2">02</option>
                            <option value="3">03</option>
                            <option value="4">04</option>
                            <option value="5">05</option>
                            <option value="6">06</option>
                            <option value="7">07</option>
                            <option value="8">08</option>
                            <option value="9">09</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="23">23</option>
                            <option value="24">24</option>
                        </select>--
                        <select name="TimeEnd" id="TimeEnd"
                                class="form-control" placeholder="开始">
                            <option value="0" selected="selected">00</option>
                            <option value="1">01</option>
                            <option value="2">02</option>
                            <option value="3">03</option>
                            <option value="4">04</option>
                            <option value="5">05</option>
                            <option value="6">06</option>
                            <option value="7">07</option>
                            <option value="8">08</option>
                            <option value="9">09</option>
                            <option value="10">10</option>
                            <option value="11">11</option>
                            <option value="12">12</option>
                            <option value="13">13</option>
                            <option value="14">14</option>
                            <option value="15">15</option>
                            <option value="16">16</option>
                            <option value="17">17</option>
                            <option value="18">18</option>
                            <option value="19">19</option>
                            <option value="20">20</option>
                            <option value="21">21</option>
                            <option value="22">22</option>
                            <option value="23">23</option>
                            <option value="24">24</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-3 control-label">时间段</label>
                    <div class="col-sm-8">
                        <select name="TimeTypePeriod" id="TimeTypePeriod"
                                class="form-control" placeholder="开始">
                            <option value="1" selected="selected">折算工作小时</option>
                            <option value="2">折算天数</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-8">
                        <button class="btn btn-info" type="submit">保存</button>
                        <button class="btn btn-white" type="button" id="btnBack">返回</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
@section styles{
    <link href="~/js/plugins/select2/css/select2.css" rel="stylesheet" />
}

@section scripts{
        <script src="~/js/jquery.validate.js"></script>
        <script src="~/js/jquery.validate.unobtrusive.js"></script>
        <script src="~/js/base.js"></script>
    <environment names="Staging,Production">
        <script src="~/js/validate.min.js" asp-append-version="true"></script>
        <script src="~/js/base.min.js" asp-append-version="true"></script>
    </environment>
    <script src="~/js/plugins/select2/js/select2.js"></script>
    <script src="~/js/BindSelect.js"></script>
    <script>
        $("#btnBack").bind("click", function (e) {
            XPage.GoTo(e.target, "@Url.Action("Index")");
        });
        $("#form1").submit(function () {
            if (Number($("#TimeEnd").val()) <= Number($("#TimeStart").val()) ) {
                alert("结束时间小于开始时间");
                return false;
            }
            return true;
        });

    </script>
}



